package swingPractice;
/**
 * @author p@!
 *
 */
import java.awt.GridLayout;
import java.awt.event.KeyEvent;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;


// JFrame - easel
// JPanel - Canvas
// paintComponent,Graphics - paint brush
// super.paintComponent(gp) - eraser 

public class FramePractice extends JFrame {

	public FramePractice() {
		setTitle("Sparta's grid");
		setSize(1006, 728);
		setResizable(false);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		init();

	}

	public void init() {
		setLayout(new GridLayout());
		
		// 
//		Menu Bar
		JMenuBar menuBar = new JMenuBar();
		
		JMenu mapOptionsMenu = new JMenu("MAP");
		
		JMenuItem createMapItem = new JMenuItem("CREATE MAP");
		createMapItem.addActionListener(new MenuActionListener());
		mapOptionsMenu.add(createMapItem);
		
		
		mapOptionsMenu.addSeparator();
		
		JMenuItem openMapItem = new JMenuItem("OPEN MAP");
		openMapItem.addActionListener(new MenuActionListener());
		mapOptionsMenu.add(openMapItem);
		
		mapOptionsMenu.addSeparator();
		
		JMenuItem saveMapItem = new JMenuItem("SAVE MAP");
		saveMapItem.addActionListener(new MenuActionListener());
		mapOptionsMenu.add(saveMapItem);
		
		mapOptionsMenu.addSeparator();
		
		menuBar.add(mapOptionsMenu);

		JMenu gameOptionsMenu = new JMenu("GAME");
		menuBar.add(gameOptionsMenu);
		
		setJMenuBar(menuBar);
		
		// add a panel over the frame
		PanelPractice panel1 = new PanelPractice();
		add(panel1);
		setVisible(true);
	}
	
	// The begining
	public static void main(String[] args) {
		FramePractice framePractice = new FramePractice();

	}

}



